/*
 * AD9954 Register function driver header file
 */

#ifndef _AD9954_H_
#define _AD9954_H_

#define SYNC_CLK_DIS 0x00000002
#define NO_DWELL 0x00000004
#define EXT_PWRDWN 0x00000008
#define CLKIN_PWRDWN 0x00000010
#define DAC_PWRDWN 0x00000020
#define COMP_PWRDWN 0x00000040
#define DIGITAL_PWRDWN 0x00000080
#define LSB_FIRST 0x00000100
#define SDIO_IN 0x00000200
#define CLR_PHASE_ACC 0x00000400
#define CLR_FREQ_ACC 0x00000800
#define SINE_COSINE 0x00001000
#define AUTO_CLR_PHASE_ACC 0x00002000
#define AUTO_CLR_FREQ_ACC 0x00004000
#define SRR_LOAD_EN 0x00008000
#define SWEEP_EN 0x00200000
#define SW_MAN_SYNC 0x00400000
#define AUTO_SYNC_EN 0x00800000
#define AUTO_OSK_EN 0x01000000
#define OSK_EN 0x02000000
#define LOAD_ARR 0x04000000
#define INT_PROFILE_BIT0 0x08000000
#define INT_PROFILE_BIT1 0x10000000
#define INT_PROFILE_BIT2 0x20000000
#define RAM_DEST 0x40000000
#define RAM_EN 0x80000000

#define CHG_PUMP_BIT0 0x00000001
#define CHG_PUMP_BIT1 0x00000002
#define VCO_RANGE 0x00000004
#define REFCLK_MUL_BIT0 0x00000008
#define REFCLK_MUL_BIT1 0x00000010
#define REFCLK_MUL_BIT2 0x00000020
#define REFCLK_MUL_BIT3 0x00000040
#define REFCLK_MUL_BIT4 0x00000080
#define XTAL_OUT_EN 0x00000200
#define HW_MAN_SYNC_EN 0x00000400
#define HS_SYNC_EN 0x00000800

#define AUTO_RAMP_BIT0 0x4000
#define AUTO_RAMP_BIT1 0x8000

extern void ad9954_init(void);
extern void ad9954_rst(void);

extern uint32_t ad9954_set_clk(uint32_t refclk, uint32_t mul);

extern void ad9954_single_tone(uint32_t freq, uint32_t phase, uint32_t clk);

#endif /* _AD9954_H_ */
